package design.Flyweight;

/**
 * Created by looper on 2017/8/17.
 */
public class FlyweightTest {
  public static void main(String[] args) {
    FlyweightFactory factory = new FlyweightFactory();

    Flyweight factory1 = factory.factory("西瓜");
    Flyweight factory2 =factory.factory("西红柿");
    Flyweight factory3 =factory.factory("苹果");
    Flyweight factory4 =factory.factory("西瓜");

    factory1.operation();
    factory2.operation();
    factory3.operation();
    factory4.operation();

    factory.getMapSize();
  }
}
